package com.yang.config.controller;

import com.yang.config.ConfigInfoProperties;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YJH
 * @version 1.0
 * @className ConfigClientController
 * @description 读取配置属性
 * @date 2020/4/2422:36
 */
@RestController
@Slf4j
@RefreshScope
public class ConfigClientController {

    @Autowired
    private ConfigInfoProperties configInfoProperties;

    @RequestMapping(value = "/getConfigInfo")
    public String getConfigInfo(){
        log.info("请求了");
        return configInfoProperties.getConfig();
    }
}
